﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Collections.ObjectModel;

namespace elr_tracking_bal.ALM
{
    public class Item : INotifyPropertyChanged
    {
        private int _ID_ITEM;
        private string _SERIE;
        private string _SKU;
        private bool _IS_ARRENDADO;
        private float _COSTO_FINAL;
        private CATALM.Item_Status _ITEM_STATUS;
        private Track _TRACK;
        private LOT.Lote_Articulo _LOTE_ARTICULO;

        ObservableCollection<Item> obs;

        public void crearCollectionItem() {
            obs = new ObservableCollection<Item>();
        }

        public void agregarItem() {
            obs.Add(new Item("TEST", 100));
        }

        public int ID_ITEM
        {
            get
            {
                return _ID_ITEM;
            }
            set
            {
                if (_ID_ITEM != value)
                {
                    _ID_ITEM = value;
                    if (this.PropertyChanged != null)
                    {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("ID_ITEM"));
                    }
                }
            }
        }

        public string SERIE
        {
            get
            {
                return _SERIE;
            }
            set
            {
                if (_SERIE != value)
                {
                    _SERIE = value;
                    if (this.PropertyChanged != null)
                    {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("SERIE"));
                    }
                }
            }
        }

        public string SKU
        {
            get
            {
                return _SKU;
            }
            set
            {
                if (_SKU != value)
                {
                    _SKU = value;
                    if (this.PropertyChanged != null)
                    {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("SKU"));
                    }
                }
            }
        }

        public bool IS_ARRENDADO
        {
            get
            {
                return _IS_ARRENDADO;
            }
            set
            {
                if (_IS_ARRENDADO != value)
                {
                    _IS_ARRENDADO = value;
                    if (this.PropertyChanged != null)
                    {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("IS_ARRENDADO"));
                    }
                }
            }
        }

        public float COSTO_FINAL
        {
            get
            {
                return _COSTO_FINAL;
            }
            set
            {
                if (_COSTO_FINAL != value)
                {
                    _COSTO_FINAL = value;
                    if (this.PropertyChanged != null)
                    {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("COSTO_FINAL"));
                    }
                }
            }
        }

        public Item(string serie, float precio) {
            this._SERIE = serie;
            this._COSTO_FINAL = precio;
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
